package com.gientech.springstream.service;

import com.gientech.springstream.stream.StreamSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service;

@Service
public class MsgService {
    @Autowired
    private StreamSource streamSource;

    public Boolean sendMsg(Object msg){
        boolean send = streamSource.output().send(MessageBuilder.withPayload(msg).build());
        return send;
    }
}
